package com.netctoss.user.action;


import com.netctoss.BaseAction;
import com.netctoss.DAOFactory;
import com.netctoss.admin.dao.IAdminDAO;
import com.netctoss.exception.DAOException;
import com.netctoss.login.entity.Admin;

public class UserInfoAction extends BaseAction{
	private String adminCode;
	private Admin admin;
	
	public String execute(){
		IAdminDAO dao = DAOFactory.getAdminDAO();
		adminCode = ((Admin) session.get("admin")).getAdminCode();
		try {
			admin = dao.findByAdminCode(adminCode);
		} catch (DAOException e) {
			e.printStackTrace();
			return "error";
		}
		return "success";
	}

	public String getAdminCode() {
		return adminCode;
	}

	public void setAdminCode(String adminCode) {
		this.adminCode = adminCode;
	}

	public Admin getAdmin() {
		return admin;
	}

	public void setAdmin(Admin admin) {
		this.admin = admin;
	}
	
}
